// import { Readable,ReadableOptions } from 'stream'
import * as fs from 'fs'

const tsFilePath: string = "/home/gj027/Software/Tsingsee/EasyNVR-linux-3.4.2-1912311740/nginx/www/record/stream_1/20200103/20200103094047/stream_1-20200103094400-4585.ts";

let index = 0;

// let fsReadStream:fs.ReadStream = fs.createReadStream(tsFilePath,{highWaterMark:188*1000});
let fsReadStream:fs.ReadStream = fs.createReadStream(tsFilePath);

fsReadStream.on('open',(fd:number) => {
    console.log("###open###");
    console.log("fd:",fd);
});

fsReadStream.on('close',()=>{
    console.log("###close###");
    console.log("index",index);
});

fsReadStream.on('data',(data:Buffer) => {
    index ++;
    // console.log("###data###");
    // console.log(data);
});
